package com.envir.utils;

import org.springframework.stereotype.Component;

//该类用来进行ThreadLocal的值的读写操作 供MyMetaObjecthandler使用
@Component
public class BaseContext {
    private static ThreadLocal<Long> threadLocal=new ThreadLocal<>();


    //往线程里写值
    public static void setId(Long id){
        threadLocal.set(id);
    }
    //读值
    public static Long getId(){
        return threadLocal.get();
    }
    //删值
    public static void removeId(){
        threadLocal.remove();
    }

}
